feat: allow components to provide absolute import path#234
feat: allow components to provide absolute import path#234
Conversation
|
I think it should still work by setting a relative path to node_modules. Are you using a virtual import pattern? An example would be nice :) |
templates/components/index.js
Outdated
| c.prefetch === true || typeof c.prefetch === 'number' ? `webpackPrefetch: ${c.prefetch}` : false, | ||
| c.preload === true || typeof c.preload === 'number' ? `webpackPreload: ${c.preload}` : false, | ||
| ].filter(Boolean).join(', ') | ||
| const filePath = c.isAbsolute ? c.filePath : `../${relativeToBuild(c.filePath)}` |
There was a problem hiding this comment.
We would need to normalize windows paths in fullPath condition
|
The import for See unplugin/unplugin-icons#63 for the implementation. This other case I can think about might be importing from some libraries, like: As for the windows path resolution, I guess since the |
|
I'm mostly hesitating to see if we really need another component option or can actually fix the situation by default. For resolving
This case makes sense. But maybe with a flag like One more point, we usually allow inherit options from |
|
Do you mean we rename |
|
Yes please, and also auto-enable the flag when |
08a7a77 to
44abecd
Compare
|
Sorry guys I don't want to disturb you here but I guess this is stale for a long time. Will this get updated? Actually, I am waiting for this PR unplugin/unplugin-icons#63 Regards. |
|
Still waiting too. |

This would allow libraries to provide absolute import paths (from library submodules, or virtual modules) using the
components:extendhook. In my case, I am integrating withunplugin-icons.